package com.woniuxy.controller;

import com.woniuxy.entity.Staff;
import com.woniuxy.service.StaffService;
import com.woniuxy.util.Result;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class ServiceController {

    @NonNull
    private StaffService staffService;

    @GetMapping("selectById/id")
    public Result selectById(@PathVariable Long id){
         Staff staff = staffService.selectById(id);
         return  Result.ok().data("staff",staff);
    }
}
